home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 5
/
Aminet 5 - March 1995.iso
/
Aminet
/
dev
/
m2
/
Turbo_1.lha
/
modula
/
docs
/
FROM_C.DOC
< prev
next >
Wrap
Text File
|
1995-01-24
|
814b
|
37 lines
/*
Exported Modula-2 variables and procedures(ie declared in some defintion module)
follow the simple link name convention:
_ModuleName_VaribleName
_ModuleName_ProcedureName
Example
=======
Calling InOut.WriteInt from 'C':
*/
/*------------ callM2.c -------------------*/
extern InOut_BEGIN(void);
extern InOut_WriteInt(int,int);
main()
{
InOut_BEGIN();/* Must call the initialization body of InOut before using it */
/* Calling InOut_BEGIN more than once wont do any harm */
InOut_WriteInt(42,2);
}
/*------------------------------------*/
/*
Compile with
>dcc -Lmodula:obj callM2.c InOut.o StdIO.o mlib:m2.lib
InOut.mod imports StdIO.mod (* include StdIO macros not implemented in c.lib *)
For an example of calling a 'C' function from within a Modula module see
directory examples/for_c/ .
*/